package com.caocaog.market.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.system.base.entity.groups.InsertGroup;
import org.jeecg.common.system.base.entity.groups.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 打印机设置
 *
 * @author chechen
 * @date 2021-11-30
 */
@Data
@TableName("mk_shop_printer")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "mk_shop_printer对象", description = "打印机设置")
public class ShopPrinter implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "创建人", hidden = true)
    private String createBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(value = "更新人", hidden = true)
    private String updateBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;

    @TableField(update = "%s+1")
    @ApiModelProperty(value = "版本号", hidden = true)
    private Integer lockVersion;

    @TableLogic
    @ApiModelProperty(value = "是否删除", hidden = true)
    private Integer delFlag;

    @NotBlank(message = "门店id不能为空", groups = {InsertGroup.class})
    @ApiModelProperty(value = "门店id", required = true)
    private String shopId;

    @ApiModelProperty(value = "打印机状态（非数据库字段，动态查出来的）")
    private transient String status;

    @Dict(dicCode = "printer_type")
    @NotNull(message = "打印机类型不能为空")
    @ApiModelProperty(value = "打印机类型", required = true)
    private Integer type;

    @NotBlank(message = "打印机名称不能为空")
    @ApiModelProperty(value = "打印机名称", required = true)
    private String name;

    @NotBlank(message = "打印机编号不能为空")
    @ApiModelProperty(value = "打印机编号", required = true)
    private String number;

    @NotBlank(message = "打印机密钥不能为空")
    @ApiModelProperty(value = "打印机密钥", required = true)
    private String printerKey;

    @ApiModelProperty(value = "流量卡号码")
    private String simNumber;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "打印次数")
    private Integer cascadeCount;

}
